{template 'common/header'}

<ul class="nav nav-tabs">
	<li class="active"><a href="{php echo $this->createWebUrl('goods', array('op'=>'display'));}">商品列表</a></li>
	<li><a href="{php echo $this->createWebUrl('goods', array('op'=>'edit'));}">添加商品</a></li>
</ul>
	<div class="panel panel-default">
		<div class="panel-heading">商品列表</div>
		<div class="panel-body">
			<div class="table-responsive panel-body">
				<table class="table table-hover" style="min-width: 300px;">
					<thead class="navbar-inner">
						<tr>
							<th class="col-sm-1">商品ID</th>
							<th class="col-sm-2">商品名称</th>
							<th class="col-sm-1">商品图片</th>
							<th class="col-sm-1">起拍价格</th>
							<th class="col-sm-1">加价幅度</th>
							<th class="col-sm-1">保证金</th>
							<th class="col-sm-1">当前价格</th>
							<th class="col-sm-2">开始时间</th>
							<th class="col-sm-2">结束时间</th>
							<th class="col-sm-1">编辑商品</th>
							<th class="col-sm-1 text-right" style="width: 120px;" >状态</th>
						</tr>
					</thead>
					<tbody>
						{loop $goodses $goodsid $goods}
						<tr>
							<td>{$goods['id']}</td>
							<td>{$goods['title']}</td>
							<td><image src="{php echo tomedia($goods['picarr']);}" style="max-width: 48px; max-height: 48px; border: 1px dotted gray"></td>
							<td>{$goods['sh_price']}元</td>
							<td>{$goods['add_price']}元</td>
							<td>{$goods['bond']}元</td>
							<td>{if ($goods['st_price']==$goods['sh_price'])}<span class="label label-default">未出价</span>{else}{$goods['st_price']}元{/if}</td>
							<td>{php echo date('Y-m-d H:i', $goods['start_time']);}</td>
							<td>{php echo date('Y-m-d H:i', $goods['end_time']);}</td>
							<td><a href="{php echo $this->createWebUrl('goods', array('op'=>'edit', 'id'=>$goods['id']));}" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="" data-original-title="编辑"><i class="fa fa-pencil"></i></a></td>
							<td class="text-right">
                           {loop $order $ord}
                           {/loop}
							{if $goods['g_status'] == 2}
								{if !empty($goods['q_uid'])}
									<a href="#" class="btn btn-default btn-sm" data-original-title="" title="">已结束</a>
								{else}{if $goods['start_time'] > time()}
									<a href="#" class="btn btn-warning btn-sm" data-original-title="" title="">待开始</a>
									{else}{if  ($ord=='')}
									{if $goods['end_time'] < time()}
									<a href="#" class="btn btn-danger btn-sm" data-original-title="" title="">已流拍</a>
									{else}
									<a href="#" class="btn btn-success btn-sm" data-original-title="" title="">进行中</a>
									{/if}
									{else}
									<a href="#" class="btn btn-success btn-sm" data-original-title="" title="">进行中</a>
								{/if}
								{/if}
								{/if}
							{else}
									<a href="#" class="btn btn-danger btn-sm" data-original-title="" title="">已下架</a>
							{/if}
								<a href="{php echo $this->createWebUrl('goods',array('op'=>'delete','id'=>$goods['id']));}" onclick="return confirm('此操作不可恢复，确认删除？');return false;" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-times"></i></a>
							</td>
						</tr>
						{/loop}
						{if empty($goodses)}
						<tr>
							<td colspan="8">
								尚未添加商品
							</td>
						</tr>
						{/if}
					</tbody>
				</table>
				{$pager}
			</div>
		</div>
	</div>
</div>

{template 'common/footer'}